package com.zut.demo1.controller;

import com.zut.demo1.service.CtpkService;
import com.zut.demo1.utils.Msg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.awt.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

@RestController
public class CtpkController {
    @Autowired
    CtpkService ctpkService;



    //上课安排
    @RequestMapping("/sk_ap")
    public Msg sk_ap(String times) throws ParseException {
        System.out.println("时间："+times);

        int count1 = ctpkService.count_ck1(times);  //未上课
        int count2 = ctpkService.count_ck2(times);  //总数
        return Msg.success().add("count1",count1).add("count2",count2-count1);
    }

    //排课情况
    @RequestMapping("/pk_ap")
    public Msg pk_an(String times){

        int count1 = ctpkService.count_pk1(times);  //已排课
        int count2 = ctpkService.count_pk2(times);  //总数
        return Msg.success().add("count1",count1).add("count2",count2-count1);
    }


}
